#include "addContactDialog.h"
addContactDialog::addContactDialog():QDialog()
{
	this->setWindowTitle(cntr("增加联系人"));
	QVBoxLayout *mainVBoxLayout = new QVBoxLayout(this);

	/*姓名*/
	QHBoxLayout *nameHBoxLayout = new QHBoxLayout();
	mainVBoxLayout->addLayout(nameHBoxLayout);
	QLabel *labName = new QLabel(cntr("姓名"), this);
	nameHBoxLayout->addWidget(labName);
	editName = new QLineEdit(this);
	nameHBoxLayout->addWidget(editName);

	/*号码*/
	QHBoxLayout *phoneNumHBoxLayout = new QHBoxLayout();
	mainVBoxLayout->addLayout(phoneNumHBoxLayout);
	QLabel *labPhone = new QLabel(cntr("号码"), this);
	editPhone = new QLineEdit(this);
	phoneNumHBoxLayout->addWidget(labPhone);
	phoneNumHBoxLayout->addWidget(editPhone);
	
	/*黑名单*/
	blackCheckBox = new QCheckBox(this);
	blackCheckBox->setText(cntr("加入黑名单"));
	mainVBoxLayout->addWidget(blackCheckBox);

	/*确定按钮*/
	QHBoxLayout *buttonHBoxLayout = new QHBoxLayout();
	mainVBoxLayout->addLayout(buttonHBoxLayout);
	QPushButton *yesButton = new QPushButton(this);
	yesButton->setText(cntr("确定"));
	buttonHBoxLayout->addWidget(yesButton);
	QPushButton *cancelButton = new QPushButton(this);
	cancelButton->setText(cntr("取消"));
	buttonHBoxLayout->addWidget(cancelButton);
	connect(yesButton, SIGNAL(clicked()), this, SLOT(accept()));
	connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
}

